<?php

/**
 * Copyright 2008 William J. Szerdy Jr.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @author Bill Szerdy <bszerdy@gmail.com>
 *
 * 12.05.2008 - bszerdy : Created.
 *
 */

require_once('config.php');

$add = 0;

if (isset($_POST['submit'])) {
	switch ($_POST['submit']) {
		case 'Save':
		 	$local_blinds = blinds_from_response($_POST);
			save_layout_blinds($local_blinds);
			break;
		case 'Add New':
			$add = 1;
			break;
	}
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>Poker Blinds</title>
		<script type="text/javascript" src="js/prototype.js"></script>
		<script type="text/javascript" src="js/jsProgressBarHandler.js"></script>
		<script type="text/javascript" src="js/timer.js"></script>
		<link type="text/css" rel="stylesheet" href="style/pokerblinds.css" media="screen" />
	</head>
	<body>
		<a id="tooCool" href="http://www.w3junkies.com/toocool/">Too Cool for Internet Explorer</a>
		<div id="main">
			<form id="blindconfig" action="config-blinds.php" method="post">
				<?php echo(layout_blinds($add)); ?>
				<br /><br />
				<input class="felt" type="submit" id="save" name="submit" value="Save" />&nbsp;
				<input class="felt" type="button" id="cancel" name="cancel" value="Cancel" />&nbsp;
				<input class="felt" type="submit" id="add_new" name="submit" value="Add New" />
			</form>
		</div>
        <div style="float:right;margin-right:65px;"><a style="text-decoration:none;color:#fff;top:0;position:absolute;" href="index.php"><< back</a></div>
	</body>
</html>